﻿using Orchard.ContentManagement;
using Orchard.ContentManagement.Drivers;

namespace AMC.SubstitutionCache.Drivers
{
    public abstract class DisplaySubstitutionDriver<TPart> : SubstitutionDriver<TPart>
        where TPart : ContentPart, new()
    {
        protected DisplaySubstitutionDriver()
        {
            AddHandledShape(() => CreateHandledShape(ShapeTypeName, GroupId));
        }

        protected abstract string ShapeTypeName { get; }

        protected ContentShapeResult PlaceholderShape(TPart part, dynamic shapeHelper, string displayType)
        {
            return PlaceholderShape(part, shapeHelper, ShapeTypeName, ShapeTypeName, string.Empty,  displayType);
        }
    }
}